﻿@model TaskSchedule

@{
    ViewData["Title"] = "Task Details";
}

<h2>Task Details</h2>

<div>
    <hr />
    <dl class="row">
        <dt class="col-sm-2">
            @Html.DisplayNameFor(model => model.Name)
        </dt>
        <dd class="col-sm-10">
            @Html.DisplayFor(model => model.Name)
        </dd>

        <dt class="col-sm-2">
            @Html.DisplayNameFor(model => model.Url)
        </dt>
        <dd class="col-sm-10">
            @Html.DisplayFor(model => model.Url)
        </dd>

        <dt class="col-sm-2">
            @Html.DisplayNameFor(model => model.HttpMethod)
        </dt>
        <dd class="col-sm-10">
            @Html.DisplayFor(model => model.HttpMethod)
        </dd>

        <dt class="col-sm-2">
            @Html.DisplayNameFor(model => model.Headers)
        </dt>
        <dd class="col-sm-10">
            <pre>@Html.DisplayFor(model => model.Headers)</pre>
        </dd>

        <dt class="col-sm-2">
            @Html.DisplayNameFor(model => model.Body)
        </dt>
        <dd class="col-sm-10">
            <pre>@Html.DisplayFor(model => model.Body)</pre>
        </dd>

        <dt class="col-sm-2">
            @Html.DisplayNameFor(model => model.CronExpression)
        </dt>
        <dd class="col-sm-10">
            @Html.DisplayFor(model => model.CronExpression)
        </dd>

        <dt class="col-sm-2">
            @Html.DisplayNameFor(model => model.IsActive)
        </dt>
        <dd class="col-sm-10">
            @if (Model.IsActive)
            {
                <span class="badge rounded-pill bg-success" style="font-size: 0.9em; padding: 5px 10px;">Active</span>
            }
            else
            {
                <span class="badge rounded-pill bg-danger" style="font-size: 0.9em; padding: 5px 10px;">Inactive</span>
            }
        </dd>

        <dt class="col-sm-2">
            @Html.DisplayNameFor(model => model.CreatedAt)
        </dt>
        <dd class="col-sm-10">
            @Html.DisplayFor(model => model.CreatedAt)
        </dd>

        <dt class="col-sm-2">
            @Html.DisplayNameFor(model => model.CreatedBy)
        </dt>
        <dd class="col-sm-10">
            @Html.DisplayFor(model => model.CreatedBy)
        </dd>
    </dl>
</div>
<div>
    <a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-primary">Edit</a>
    <a asp-action="Index" class="btn btn-secondary">Back to List</a>
</div>